package com.springboot.template.timer;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledDemo {

//    @Scheduled(fixedRate = 3000)  //现在和每3秒执行一次
//    @Scheduled(cron = "0/1 * * * * ? ") //从0秒开始每秒执行一次
    public void task() {
        System.out.println("Hello World");
    }
}
